using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace comm.objst
{
    [Serializable]
    public class TableBackpack : ICodeReplace
    {
#region 2013-1-4 19:16:52
public const string KEY_BACKPACK_ID="BackpackId";
public const string PLAYER_ID="PlayerId";
public const string NAME="Name";
public const string MAX="Max";
public const string ITEM_DIC="ItemDic";

#endregion
public comm.CodeFill FillRegion()
        {
            return new CodeFill(CodeFillType.ORM_CONST, this);
        }

        private string _backpackId = null;
        [OrmAttr(true)]
        public string BackpackId
        {
            get
            {
                if (_backpackId == null)
                {
                    _backpackId = comm.GUID.NewString();
                }
                return _backpackId;
            }
            set { _backpackId = value; }
        }

        private string _playerId = null;
        public string PlayerId
        {
            get
            {
                if (_playerId == null)
                {
                    _playerId = "";
                }
                return _playerId;
            }
            set { _playerId = value; }
        }

        private string _name = null;
        public string Name
        {
            get
            {
                if (_name == null)
                {
                    _name = "";
                }
                return _name;
            }
            set { _name = value; }
        }

        public int Max { get; set; }

        private Dictionary<int, BackpackItem> _itemDic = null;
        public Dictionary<int, BackpackItem> ItemDic
        {
            get
            {
                if (_itemDic == null)
                {
                    _itemDic = new Dictionary<int, BackpackItem>();
                }
                return _itemDic;
            }
            set { _itemDic = value; }
        }
    }
}
